<%@page import="Sample.Student"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ProcessStudentLogin</title>
</head>
<body>
	<!-- Create Student object -->
	<jsp:useBean id="stu" class="Sample.Student" scope="page" />
	<!--  Set properties -->
	<%-- 	<jsp:setProperty property="name" name="stu" param="FullName"/>
	<jsp:setProperty property="id" name="stu" param="StudentID"/> --%>
	<jsp:setProperty property="*" name="stu" />

	<%-- 	<jsp:setProperty property="name" name="student" />
	<jsp:setProperty property="id" name="student" /> --%>

	<!-- Finish create and set properties -->

	<%	
		//set session object
		if("abc".equals(stu.getName()) && "123".equals(stu.getId())){
			Sample.Student student = new Sample.Student();
			student.setId(stu.getId());
			student.setName(stu.getName());
			session.putValue("User", student);
	%>
	<jsp:forward page="ShowLoginResult.jsp"></jsp:forward>
	<%
		}else{
			
			out.print("Login fail: " + stu.getName() + " has " + stu.getId() + "</br>");
			
		}
	%>

	<%-- 	Student Name: ${stu.name}
	Student Id: ${stu.id} --%>

</body>
</html>